package gradle.common.core.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.servlet.http.HttpServletResponse;
import lombok.Data;

/**
 * 基础返回实体
 */
@Data
@Schema(description = "基础返回实体")
public class BaseResponse {

    public static final String SUCEESS_MESSAGE = "success";

    /**
     * 响应状态码
     */
    @Schema(description = "响应状态码")
    private int status = HttpServletResponse.SC_OK;

    /**
     * 响应描述
     */
    @Schema(description = "响应描述")
    private String message;

    /**
     * 堆栈跟踪信息
     */
    @Schema(description = "堆栈跟踪信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String stackTrace;

    /**
     * 堆栈跟踪id
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Schema(description = "堆栈跟踪id")
    private String traceId;

    public BaseResponse() {
    }

    public BaseResponse(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public BaseResponse(int status, String message, String stackTrace) {
        this.status = status;
        this.message = message;
        this.stackTrace = stackTrace;
    }


}
